-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ast api #47
Merged
Merged
Refactor ast api #47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ygg01
force-pushed
the
refactor-ast-api
branch
from
January 13, 2024 01:17
0dff831
to
2d32d56
Compare
The serializers for FunctionReference and DynamicReference have been refactored and fixed. This includes updating conditions for properties and handling potential null values. Removed redundant converter in TestUtil following restructuring of serialization tests.
Updated and implemented multiple serializers in Linguini.Serialization to handle different types of data, including patterns, placeables, and named arguments. Additional tests were added in SerializeAndDeserializeTest.cs to verify correct serialization. Significant changes were also made to PatternSerializer and NamedArgumentSerializer.
A suite of new test cases have been added to SerializeAndDeserializeTest for comprehensive testing. Changes have been incorporated to the way of comparing Identifiers, using Identifier.Comparator for accurate comparisons.
Implemented equality logic for AstComment class in Entry.cs allowing for more complex comparisons. In addition to this, JSON deserialization has been implemented in CommentSerializer.cs allowing for reading AstComment from JSON. Now AstComment can be accurately compared and serialized from JSON format.
The commit moves the methods for variant and number literal serializations from the ResourceSerializer class to the VariantSerializer class. The move aids in organization and code readability, as variant serialization is now better isolated and number literal serialization is directly utilized in variant serialization. Exception messages for invalid inputs have also been improved during the refactoing.
Previously, all deserialization methods in the Converters threw a 'NotImplementedException'. The new updates replace these methods with actual implementations, ensuring that when serialized objects are read back, they are correctly converted back to their original form. This change improves the overall functionality and efficiency of the serialization process.
The serialization and deserialization test suite has been updated for clarity and performance. The process is now consolidated into a single method called `RoundTripTest()`. Additionally, equality implementations for `AstMessage` and `Junk` classes have been added, allowing for more reliable object comparison in tests. Implementations for processing `Junk` and `AstMessage` have been tweaked for correctness and better error reporting.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Various refactors:
readonly
AstMessage
/AstTerm
Fixes #46